<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
    <head>
        <title>Title</title>
        <%
            String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
            /*
            * request.getScheme() : http
            * request.getServerName() : localhost
            * request.getServerPort() : 端口号
            * request.getContextPath() : /获取虚拟目录名(项目名jsp_framework)
            * */
        %>
        <base href="<%=basePath%>">

        <script src="js/jquery-3.3.1.js"></script>
        <script>
        $(function () {
            $("#checkCodeImg").click(function () {
                this.src = "checkCodeServlet?time=" + new Date().getTime();
            });
        });
        </script>
    </head>
    <body>


    <form action="${pageContext.request.contextPath}/communication/login" method="post">
            <table>
                <tr>
                    <th colspan="2">登录</th>
                </tr>
                <tr>
                    <td>用户名:</td>
                    <td><input type="text" name="username1"></td>
                </tr>
                <tr>
                    <td>密码:</td>
                    <td><input type="password" name="password"></td>
                </tr>
                <tr>
                    <td>验证码:</td>
                    <td><input type="text" name="checkCode"></td>
                    <td><img src="checkCodeServlet" id="checkCodeImg"></td>
                </tr>
                <tr>
                    <td>记住:</td>
                    <td><input type="checkbox" name="remember" value="remember-me"></td>
                </tr>
                <tr>
                    <td colspan="2"><input type="submit" value="登录"></td>
                </tr>
            </table>
        </form>
        <br><br>


        <c:if test="${not empty msg }">
            <strong>提示信息: ${msg}</strong>
        </c:if>
        <c:if test="${empty msg }">
            <strong>提示信息: </strong>
        </c:if><br><br>





    </body>
</html>

























